package com.xin.di.uav.operate.rest;

import com.xin.di.uav.common.request.user.UserExtraRequest;
import com.xin.di.uav.common.response.user.UserExtraResponse;
import com.xin.di.uav.operate.service.IUserExtraService;
import com.xin.di.uav.user.entity.UserExtra;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户额外信息表 前端控制器
 * </p>
 *
 * @author LTQ
 * @since 2023-06-14
 */
@RestController
@RequestMapping("/applet/userExtra")
public class UserExtraRest {

    @Autowired
    private IUserExtraService iUserExtraService;

    @PostMapping("/add")
    public void add(UserExtraRequest userExtraRequest) {
        iUserExtraService.add(userExtraRequest);
    }

    @PostMapping("/edit")
    public void edit(UserExtraRequest userExtraRequest) {
        iUserExtraService.edit(userExtraRequest);
    }


    @GetMapping("/get-by-id")
    public UserExtraResponse getById(@RequestParam String id) {
        return iUserExtraService.getById(id);
    }

    @GetMapping("/get-by-user-id")
    public UserExtra getByUserId(String userId) {
        return iUserExtraService.getByUserId(userId);
    }
}
